//https://www.yuque.com/wangpengfei-kgu2c/dupr81/azlfno#EI27D

const M=require("ming_node");
const WxOfficialServerPlugin= require("../WxOfficialServerPlugin")

//创建一个文件Rpc风格api用于存储数据
const Api= require("ming_node/plugins/BaseRpcApi/FileBaseRpcApi");
let api = new Api({tableName:"ming.json",generateTime:true})


app=M.server()
app.listen(8888)

//视图层为当前目录
app.set("views",".")

//安装微信插件
app.use(new WxOfficialServerPlugin({
    //公众平台申请的公众号appid
    appid:"wxb82ed6f75c3a22ad",
    //公众平台申请的公众号appsecret
    appsecret:"999915ad9371781036b2bf8f917a28fd",
    //微信服务的code通过此地址给后端
    redirect_uri:"http://minglie8888.vaiwan.com/wx/getCode",
    //本地开发不方便redirect_uri会转发到proxy_redirect_uri
    proxy_redirect_uri:"http://minglie8888.vaiwan.com/wx/wxcallback/local",
    //前端的wx.config参数,通过此地址获取
    wxConfigServerUrl:"/proxyScan",
    //登陆成功后默认跳转的地址,后端会带上openid
    defaultSuccessRedirectUrl:"",
}),api);